#ifndef _ILIVING_H_
#define _ILIVING_H_

/**
 * A living object interface.
 *
 * Living object has some health, can be hurt, killed but also healed.
 * It can also anounce its "death" by a callback.
 */
class ILiving
{
public:
  typedef void (*killCallbackFunction)(ILiving*);

  /**
   * Returns the health of the object.
   *
   * @return Health of the object.
   */
  virtual int getHealth() const = 0;

  /**
   * Hurts the object by a given amount.
   *
   * @arg[in] i : Damage to be dealt
   */
  virtual void hurt(int i) = 0;

  /**
   * Heals the object by a given amount.
   *
   * @arg[in] i : How many points the object will be healed
   */
  virtual void heal(int i) = 0;

  /**
   * Set a callback function, that will be called when the object dies.
   *
   * @arg[in] f : Function that will be called upon the object's death
   */
  virtual void setKillCallback(killCallbackFunction f) = 0;
};
#endif /* _ILIVING_H_ */

